home *** CD-ROM | disk | FTP | other *** search
- /* ATARI Explorer, Dec'86 ,for MWC */
- #include <stdio.h>
- #include <gemdefs.h>
- #include <osbind.h>
-
- /* global control arrays for VDI */
- int contrl[12];
- int intin[128];
- int ptsin[128];
- int intout[128];
- int ptsout[128];
-
- /*Global variables for application*/
- int handle, dummy, xres,yres;
- int work_in[11], work_out[57];
-
- main()
- {
- int i;
- char ch;
- for ( i = 0 ; i < 10 ; work_in[i++] = 1 );
- work_in[10] = 2 ; /* swiss font */
- appl_init() ;
- handle = graf_handle( &dummy, &dummy, &dummy, &dummy );
- /*VOID*/ v_opnvwk(work_in,&handle,work_out);
- xres = work_out[0]; /* open vir.wrk.station */
- yres = work_out[1];
- /*VOID*/ v_hide_c(handle); /* hide mouse */
- do /* line drawing demonstration */
- {
- linedemo();
- while ( ! Bconstat (2));
- }
- while (( ch = Bconin(2)) != '\33');
- printf("\33E\33e\n"); /* clears screen, homes & shows cursor */
- v_show_c(handle); /* shows mouse */
- v_clsvwk(handle); /* closes virtual workstation */
- appl_exit(); /* exits application */
- }
- linedemo() /* Function: Perform line Demonstration */
- {
- int pxyarray[4], rgb_in[3];
- int style, width, beg_style, end_style;
- /* Clear screen, home and show cursor */
- printf(" \33E\33e\n ");
- printf("1 = solid \n 2 = long dash \n 3 = dot \n");
- printf(" 4 = dash dot \n 5 = dash \n 6 = dash dot dot\n\n" );
- printf(" Enter line style< 1 - 7 >: " );
- scanf ( "%d" , &style );
- vsl_type ( handle , style );
- printf(" \n\n Enter line width< 1 - n/2 pixels>: " );
- scanf ( "%d" , &width );
- vsl_width( handle , width );
- printf(" \n\n0 = squared\n1 = arrow\n2 = rounded\n\n " );
- printf(" Enter first line end style<0,1,2>: " ) ;
- scanf ( "%d" , &beg_style ) ;
- printf(" \nEnter second line end style<0,1,2>1: \n");
- scanf ( "%d" , &end_style ) ;
- vsl_ends(handle,beg_style,end_style ) ;
- printf(" Enter 3 color variables(red,grn,blu). \n" ) ;
- printf(" Each may range from 1 to 1000. \n\n" ) ;
- printf(" \n Enter RED Value: " ) ;
- scanf ( "%d" , &rgb_in[0] ) ;
- printf(" \n Enter GREEN Value: " ) ;
- scanf ( "%d" , &rgb_in[1] ) ;
- printf(" \n Enter BLUE Value: " ) ;
- scanf ( "%d" , &rgb_in[2] ) ;
- vs_color(handle,2,rgb_in);
- vsl_color(handle,2);
- /* Get Coordinates */
- printf( "\n\n Enter X-coordinate of starting point. \n" ) ;
- printf(" (May range from 0 - %d): ",xres ) ;
- scanf ( "%d" , &pxyarray[0] ) ;
- printf( "\n\n Enter Y-coordinate of starting point. \n" ) ;
- printf(" (May range from 0 - %d): ",yres ) ;
- scanf ( "%d" , &pxyarray[1] ) ;
- printf( "\n\n Enter X-coordinate of ending point. \n" ) ;
- printf(" (May range from 0 - %d): ",xres ) ;
- scanf ( "%d" , &pxyarray[2] ) ;
- printf( "\n\n Enter Y-coordinate of ending point. \n" ) ;
- printf(" (May range from 0 - %d): ",yres ) ;
- scanf ( "%d" , &pxyarray[3] ) ;
- /* Clear screen, home and hide cursor */
- printf( "\33E\33f\n" ) ;
- /* DRAW LINE */
- v_pline(handle,2,pxyarray);
- }
-
- /* Then blow them away with the PGG Listing 3.6 page171: */
-